package com.briup.exception;

import com.briup.enums.CodeAndMessageEnum;

public class SystemException extends Exception{
    /**
     * 统一响应枚举
     */
    private CodeAndMessageEnum codeAndMessageEnum;

    /**
     * 系统异常
     *
     * @param codeAndMessageEnum 代码和消息枚举
     */
    public SystemException(CodeAndMessageEnum codeAndMessageEnum){
        super(codeAndMessageEnum.getMessage());
        this.codeAndMessageEnum = codeAndMessageEnum;
    }

    /**
     * 获取统一响应枚举
     *
     * @return {@link CodeAndMessageEnum}
     */
    public CodeAndMessageEnum getCodeAndMessageEnum() {
        return codeAndMessageEnum;
    }
}
